package exio;

import java.io.FileWriter;
import java.io.IOException;
import java.time.LocalDateTime;

/**
 * @description: 测试FileWriter日志功能
 * @author: knowno
 * @create: 2025-09-16 15:37
 * @Version 1.0
 **/
public class TestFileWriterLog {
    public static void main(String[] args) throws IOException {

        //可追加写入
        FileWriter fileWriter = new FileWriter("g:\\0916-2.txt",true);

        //直接写入字符串
        fileWriter.write(LocalDateTime.now().toString()+" - "+" login success...\r\n");
        fileWriter.close();
        System.out.println("写入日志成功");
    }
}
